package com.ruoyi.project.test.gds.formal;

import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;
import java.util.concurrent.ConcurrentHashMap;

@Configuration
public class GdsParameter {

    public static ConcurrentHashMap<String, String> gdsParameterMap = new ConcurrentHashMap();

    public static final String HEADER = "0002";
    public static final String BGNLIB = "0102";
    public static final String LIBNAME = "0206";
    public static final String REFLIBS = "1F06";
    public static final String FONTS = "2006";
    public static final String ATTRTABLE = "2306";
    public static final String GENETATIONS = "2202";

    public static final String FORMAT = "3602";
    public static final String MASK = "3706";
    public static final String ENDMASK = "3800";
    public static final String UNITS = "0305";

    public static final String BGNSTR = "0502";
    public static final String STRNAME = "0606";

    public static final String BOUNDARY = "0800";
    public static final String PATH = "0900";
    public static final String SREF = "0A00";
    public static final String AREF = "0B00";
    public static final String TEXT = "0C00";
    public static final String NODE = "1500";
    public static final String BOX = "2D00";

    public static final String ELFLAGS = "2601";
    public static final String PLEX = "2F03";
    public static final String LAYER = "0D02";
    public static final String DATATYPE = "0E02";
    public static final String XY = "1003";
    public static final String PATHTYPE = "2102";
    public static final String WIDTH = "0F03";
    public static final String SNAME = "1206";
    public static final String STRANS = "1A01";
    public static final String MAG = "1B05";
    public static final String ANGLE = "1C05";
    public static final String CLOROW = "1302";
    public static final String TEXTTYPE = "1602";
    public static final String PERSENTATION = "1701";
    public static final String ASCII = "1906";
    public static final String NODETYPE = "2A02";
    public static final String BOXTYPE = "2E02";
    public static final String ENDNET = "1100";
    public static final String ENDSTR = "0700";
    public static final String ENDLIB = "0400";

    @PostConstruct
    public static void gdsParameterInit(){
        /*文件头*/
        //int16
        gdsParameterMap.put("0002","HEADER(文件头)");
        //12个int16
        gdsParameterMap.put("0102","BGNLIB(库文件头)");
        //ASCII字符串
        gdsParameterMap.put("0206","LIBNAME(库文件名)");
        //90个char
        gdsParameterMap.put("1F06","REFLIBS(参考文件)");
        //176个char
        gdsParameterMap.put("2006","FONTS(字体)");
        //44个char
        gdsParameterMap.put("2306","ATTRTABLE(属性)");
        //int16
        gdsParameterMap.put("2202","GENETATIONS(备份文件数)");
        //int16
        gdsParameterMap.put("3602","FORMAT(格式)");
        //ASCII字符串
        gdsParameterMap.put("3706","MASK(掩膜)");
        //
        gdsParameterMap.put("3800","ENDMASK(掩膜结束)");
        //2个float64
        gdsParameterMap.put("0305","UNITS(单位)");

        /*模块结构头*/
        //12个int16
        gdsParameterMap.put("0502","BGNSTR(模块结构头)");
        //最多32个char
        gdsParameterMap.put("0606","STRNAME(模块结构名)");

        /*图素头*/
        gdsParameterMap.put("0800","BOUNDARY(填充多边形)");
        gdsParameterMap.put("0900","PATH(线条)");
        gdsParameterMap.put("0A00","SREF(模块插入属性)");
        gdsParameterMap.put("0B00","AREF(阵列)");
        gdsParameterMap.put("0C00","TEXT(文字)");
        gdsParameterMap.put("1500","NODE(拓扑点)");
        gdsParameterMap.put("2D00","BOX");

        /*图素*/
        //int16
        gdsParameterMap.put("2601","ELFLAGS");
        //int32
        gdsParameterMap.put("2F03","PLEX");
        //int16
        gdsParameterMap.put("0D02","LAYER(层)");
        //int16
        gdsParameterMap.put("0E02","DATATYPE(数据类型)");
        //最多200个int32
        gdsParameterMap.put("1003","XY(坐标)");
        //int16
        gdsParameterMap.put("2102","PATHTYPE(线端类型)");
        //int32
        gdsParameterMap.put("0F03","WIDTH(宽度)");
        //最多32个char
        gdsParameterMap.put("1206","SNAME(插入模块结构名)");
        //int16
        gdsParameterMap.put("1A01","STRANS(坐标变换)");
        //int64
        gdsParameterMap.put("1B05","MAG(缩放)");
        //int64
        gdsParameterMap.put("1C05","ANGLE(角度)");
        //2个int16
        gdsParameterMap.put("1302","CLOROW(行列数)");
        //int16
        gdsParameterMap.put("1602","TEXTTYPE(文字类型)");
        //int16
        gdsParameterMap.put("1701","PERSENTATION");
        //最多512个char
        gdsParameterMap.put("1906","ASCII STRING(字符串)");
        //int16
        gdsParameterMap.put("2A02","NODETYPE(拓扑点类型)");
        //int16
        gdsParameterMap.put("2E02","BOXTYPE");

        /*图素尾…(可包含多个图素参数)*/
        gdsParameterMap.put("1100","ENDNET(图素参数结束)");

        /*模块结构尾…(可包含多个结构参数)*/
        gdsParameterMap.put("0700","ENDSTR(模块结构结束)");

        /*文件尾*/
        gdsParameterMap.put("0400","ENDLIB(库文件结束)");
    }
}
